<template>
	<view class="main">
		<view class="hand">
			<image src="https://qiniu.jxyutuo.com/yanqin/tabBarimg/dbleft.png" @click="blackbtn"></image>
			输入身份证
		</view>
		<view class="show">
			<span>法人身份证号:</span>
			<input placeholder="请输入法人身份证号" v-model="personIdNo" @input="TypeInput" maxlength="18"/>
		</view>
		<view class="tap" @click="gobtn()">
			下一步
		</view>


	</view>
</template>

<script>
	
	export default {
		components: {
		},
		mounted() {

		},

		data() {
			return {
				personIdNo:''
			}
		},
		onLoad(option) {
			
		},
		onShow() {
			
			
		},
		methods: {
			//返回上一页
			blackbtn() {
				uni.redirectTo({
					url: '../withdrawal_management/withdrawal_management'
				})	
			},
			gobtn(){
				if(this.checkIdCard(this.personIdNo)==false&&this.personIdNo!=''){
					this.$toast.fail('身份证格式不正确')
				}else{
					uni.navigateTo({
						url: '../open_account/open_account?personIdNo=' + this.personIdNo
					});
				}
			},
			checkIdCard(idCard) {
			 var idCardPattern = /^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}([0-9]|X)$/
			 if (!idCardPattern.test(idCard)) {
			   return false
			 } else {
			   return true
			 }
			
			},
			TypeInput(e) {
				// 只能输入数字的验证;
				let inputType = /[\W]/g
				this.$nextTick(function() {
					this.personIdNo = e.detail.value.replace(inputType, '');
				})
			},
			
		}
	}
</script>

<style lang="scss" scoped>
	.main {
		width: 100%;
		overflow-x: hidden;
		// background-color: #F5F5F5;

		/deep/.van-list__finished-text {
			margin-top: 100upx;
			padding-bottom: 200upx;
		}

		/deep/.van-hairline--top-bottom::after {
			border-width: 0;
		}
		.hand{
			text-size-adjust: 100% !important;
			-webkit-text-size-adjust: 100% !important;  
			-moz-text-size-adjust: 100% !important;
			width: 100%;
			background-color:#4B98ED;
			font-size: 30upx;
			padding: 20upx 0;
			font-family: PingFang SC Bold, PingFang SC Bold-Bold;
			font-weight: 700;
			text-align: center;
			color: #ffffff;
			position: relative;
			image{
				width:22upx;
				height: 39upx;
				position: absolute;
				left: 31upx;
				top: 22upx;
			}
		}
		.show{
			position: fixed;
			top: 40%;
			left: 5%;
			width: 90%;
			background-color: #f0f0f0;
			display: flex;
			box-sizing: border-box;
			padding:100upx 32upx;
			border-radius: 20upx;
			align-items: center;
			span{
				font-size: 28upx;
				color: #333;
				font-weight: 700;
				margin-right: 32upx;
			}
			input{
				width: 60%;
				background-color: #c8c8c8;
				border-radius: 20upx;
				padding: 20upx ;
				font-size: 28upx;
				font-weight: 700;
			}
			/deep/.uni-input-placeholder{
				font-size: 28upx;
				color: #727272;
			}
			
			
		}
		.tap{
			position: fixed;
			bottom: 10%;
			width: 300upx;
			border-radius: 20upx;
			background-color: #4B98ED;
			color: #ffffff;
			text-align: center;
			padding: 20upx 0;
			left: 29.5%;
		}
		

	}
</style>
